pp108 : Log Consumers

Log Consumers

This topic describes the types of log consumers.


Log consumer is any application which consumes log messages. Process Platform supports various kinds of log consumers, including those from Log4j, for consuming log messages. One or more consumers can be selected for publishing messages. The appropriate log consumer must be selected during the Service configuration.

The following types of log consumers are used to publish the log messages:

  • File - The File consumer writes log messages to the file and location specified during log configuration. If you do not specify any directory or folder path, the default path for this file is <Process_Platform_Installation_Directory>\Logs\<filename.xml>. If the file name is not specified, the log messages are published to the console.

    Note

    • For installation on Linux, after installing the patch, the Process Platform user must have the read and write permissions on the Process Platform Installation Directory to publish alerts and log statements to the file. If the file name contains folders, requisite permissions must be assigned to the folders.
    • In the Publish to File field of the Logger Consumers pane on the Service - Parser Processor window, use a double-slash while specifying the folder path. For example, <Drive>:folder1testlog.txt instead of <Drive>:\folder1\testlog.txt.

    There are following types of files:

    • Rolling File - This is similar to writing to file except that when the log file crosses a specified file size, it is rolled over. The messages are then published to the file with a new name. If such a name already exists, it writes to a file with a new name. The maximum file size must be specified, during the Service configuration.
    • Daily Rolling File - In this option, the messages are published to the file specified and files are rolled over based on user-defined time intervals, which can be monthly, weekly, daily, and so on. You must specify the file name and the time at which the file must be rolled over. 
      You can use the following formats: 
      • Roll over monthly - yyyy-MM 
      • Roll over weekly - yyyy-ww 
      • Roll over daily - yyyy-MM-dd 
      • Roll over every hour - yyy-MM-dd-HH 
      • Roll over each minute - yyyy-MM-dd-HH-mm
  • Socket - This option publishes the log messages to the specified socket. You must specify the machine name and port number while configuring the logger.
  • OS-based Event Log - Log messages are published to either the Windows Event Log for Windows operating system or Syslog with facility LOCAL7 for Linux operating system.

The default consumer to which log messages are written is called  ProcessNamedDailyRollingFileAppender . The file location for this consumer is <Process_Platform_Installation_Directory>\Logs. The naming convention for this depends on the process to which the log messages are written. For each process, a log file is created.

  • For Service, it is <Organization Name>#<Service Group DN>#<Service DN>.xml. For example, system#xml_store_service#xml_store_processor.xml (spaces are replaced with an underscore)
  • For OS process, it is the <OS Process Name>.xml (for example, MyOSProcess.xml is created for an OS Process named MyOSProcess). These log files can be viewed by selecting the View Log option in the context menu available for OS process.
  • For monitor, it is Monitor.xml and by default, this is available in <Process_Platform_Installation_Directory>\Logs directory.
  • For gateway, it is Gateway.xml and this is available in <Process_Platform_Installation_Directory>\Logs directory.

    Note:

    • If log messages to be published do not fall in any of the above four categories, they are published to General.xml in <Process_Platform_Installation_Directory>\Logs directory.
    • Process Platform Logger supports all the Log4j Appenders. In such a case, one can directly use the log4J configuration for logging purposes with some customizations.